home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16400 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news.callamer.com!news@twizzler.callamer.com
  2. From: ryost@fix.net (Ron Yost)
  3. Newsgroups: comp.lang.c++
  4. Subject: Q: C++ read comma delim. text file & parse  How?
  5. Date: Wed, 10 Apr 1996 17:02:48 GMT
  6. Organization: Flying Frog Productions
  7. Distribution: world
  8. Expires: 2
  9. Message-ID: <316be5bd.148077@news.fix.net>
  10. Reply-To: ryost@fix.net
  11. NNTP-Posting-Host: fix16.fix.net
  12. X-Newsreader: Forte Agent .99c/16.141
  13.  
  14. Hi all,
  15. I'm new to C++ (BC++ 4.52) and have old 'legacy' prg I need to port to C++.
  16. I have ascii text files that serve as 'look up tables' for conversion routines,
  17. to re-map (transpose) MIDI note numbers in a standard MIDI song file, and need
  18. to read in comma delimited data and ignore comments after each line.
  19.  
  20. They're organized like this:
  21.  
  22. ** MIDIMAP DATA **              < Header; to make sure file is correct.
  23. 144,56,145,78  comments      <Want to read the 4 numbers in each row
  24. 145,34,144,45  comments      <and parse the documentary comments
  25. 145,78,146,78  comments      <after the rows. The comments are 35 chars max.
  26. 146,34,145,56  comments      <The data represents channel, note number.
  27.  
  28. The files are 96 rows long, with four columns of numbers. I know I'll have to
  29. convert the numbers from text to real numbers. These are to be read into 4
  30. separate arrays, which will use the same index.
  31.  
  32. Each row represents one MIDI note; 
  33. First two numbers are an existing MIDI channel number and note number, say
  34. 144,56.
  35. Second two numbers are what to change that to, say 145,78
  36.  
  37. This came from GFA Basic on an Atari ST, and I used the RIGHT$ function in basic
  38. to parse the comments, but how in C++?? Sorry if this seems simple and stupid!!
  39.  
  40. Any help would be appreciated! THANKS a bunch!
  41.  
  42. Ron Yost <ryost@fix.net>
  43. Paso Robles, CA
  44.